Example:The following example shows how to use named tag type.
import com.cete.dynamicpdf.*; import com.cete.dynamicpdf.pageelements.*; public class MyClass{ public static void main(String args[]){ // Create a PDF Document Document document = new Document(); // Specify document as a tagged PDF document.setTag(new TagOptions()); // Create a page and add it to the document Page page = new Page(); document.getPages().add(page); // Create a text area TextArea textArea = new TextArea("This is the " + "text of a TextArea", 100, 100, 400, 30, Font.getHelveticaBoldOblique(), 18); // Create a named tag type NamedTagType namedTagType = new NamedTagType("Para", TagType.getParagraph()); // Create a structue element StructureElement structureElement = new StructureElement(namedTagType, true); // Tag the text area with the structure element textArea.setTag(structureElement); // Add the text area to the page page.getElements().add(textArea); //Save the PDF document.draw("[PhysicalPath]/MyDocument.pdf" ); } }